/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ComponenteEntidad;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Marilyn
 */
@Entity
@Table(name = "detallecliente")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Detallecliente.findAll", query = "SELECT d FROM Detallecliente d"),
    @NamedQuery(name = "Detallecliente.findByIdDetalleCliente", query = "SELECT d FROM Detallecliente d WHERE d.idDetalleCliente = :idDetalleCliente"),
    @NamedQuery(name = "Detallecliente.findByDcliDireccion", query = "SELECT d FROM Detallecliente d WHERE d.dcliDireccion = :dcliDireccion"),
    @NamedQuery(name = "Detallecliente.findByDcliTelefono", query = "SELECT d FROM Detallecliente d WHERE d.dcliTelefono = :dcliTelefono"),
    @NamedQuery(name = "Detallecliente.findByDcliCelular", query = "SELECT d FROM Detallecliente d WHERE d.dcliCelular = :dcliCelular"),
    @NamedQuery(name = "Detallecliente.findByDcliEmail", query = "SELECT d FROM Detallecliente d WHERE d.dcliEmail = :dcliEmail")})
public class Detallecliente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idDetalleCliente")
    private Integer idDetalleCliente;
    @Basic(optional = false)
    @NotNull
    @Size(min = 0, max = 250)
    @Column(name = "dcli_Direccion")
    private String dcliDireccion;
    @Size(max = 15)
    @Column(name = "dcli_Telefono")
    private String dcliTelefono;
    @Size(max = 15)
    @Column(name = "dcli_Celular")
    private String dcliCelular;
    @Size(max = 60)
    @Column(name = "dcli_email")
    private String dcliEmail;
    @JoinColumn(name = "idPersona", referencedColumnName = "idPersona")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Cliente cliente;

    public Detallecliente() {
    }

    public Detallecliente(Integer idDetalleCliente) {
        this.idDetalleCliente = idDetalleCliente;
    }

    public Detallecliente(Integer idDetalleCliente, String dcliDireccion) {
        this.idDetalleCliente = idDetalleCliente;
        this.dcliDireccion = dcliDireccion;
    }

    public Integer getIdDetalleCliente() {
        return idDetalleCliente;
    }

    public void setIdDetalleCliente(Integer idDetalleCliente) {
        this.idDetalleCliente = idDetalleCliente;
    }

    public String getDcliDireccion() {
        return dcliDireccion;
    }

    public void setDcliDireccion(String dcliDireccion) {
        this.dcliDireccion = dcliDireccion;
    }

    public String getDcliTelefono() {
        return dcliTelefono;
    }

    public void setDcliTelefono(String dcliTelefono) {
        this.dcliTelefono = dcliTelefono;
    }

    public String getDcliCelular() {
        return dcliCelular;
    }

    public void setDcliCelular(String dcliCelular) {
        this.dcliCelular = dcliCelular;
    }

    public String getDcliEmail() {
        return dcliEmail;
    }

    public void setDcliEmail(String dcliEmail) {
        this.dcliEmail = dcliEmail;
    }

    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDetalleCliente != null ? idDetalleCliente.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Detallecliente)) {
            return false;
        }
        Detallecliente other = (Detallecliente) object;
        if ((this.idDetalleCliente == null && other.idDetalleCliente != null) || (this.idDetalleCliente != null && !this.idDetalleCliente.equals(other.idDetalleCliente))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ComponenteEntidad.Detallecliente[ idDetalleCliente=" + idDetalleCliente + " ]";
    }
    
}
